package com.acarter.scenemonitor.propertydescriptor.enums;
/**
 * <p>
 * Title
 * </p>
 * <p>
 * Description:
 * </p>
 * <p>
 * Copyright (c) 2007
 * </p>
 * 
 * @author Andrew Carter
 * @version
 */

/**
 * Enumerates the permissible texture render to texture source.
 * 
 * @author Andrew Carter
 */
public enum E_TextureRTT {

  RTT_SOURCE_RGB("RTT_SOURCE_RGB", 0),
  
  RTT_SOURCE_RGBA("RTT_SOURCE_RGBA", 1),
  
  RTT_SOURCE_DEPTH("RTT_SOURCE_DEPTH", 2),
  
  RTT_SOURCE_LUMINANCE("RTT_SOURCE_LUMINANCE", 3),
  
  RTT_SOURCE_LUMINANCE_ALPHA("RTT_SOURCE_LUMINANCE_ALPHA", 4),
  
  RTT_SOURCE_ALPHA("RTT_SOURCE_ALPHA", 5),
  
  RTT_SOURCE_INTENSITY("RTT_SOURCE_INTENSITY", 6);
	
	/** String representation of the enum value */
	private String name;

	/** Integer value of the enum value */
	private int value;

	/**
	 * Private constructor.
	 * 
	 * @param value String literal of the enum
	 */
	private E_TextureRTT(String name, int value) {

		this.name = name;
		this.value = value;
	}

	/**
	 * Returns the enum constant matching the name string.
	 * 
	 * @param name string value of enum constant
	 * @return matching enum constant or null
	 */
	public static E_TextureRTT getConstant(String name) {

		for(E_TextureRTT constant : E_TextureRTT.values()) {

			if(constant.toString().compareToIgnoreCase(name) == 0)
				return constant;
		}

		return null;
	}

	/**
	 * Returns the enum constant matching the type value.
	 * 
	 * @param type type value of enum constant
	 * @return matching enum constant or null
	 */
	public static E_TextureRTT getConstant(int type) {

		for(E_TextureRTT constant : E_TextureRTT.values()) {

			if(constant.getType() == type)
				return constant;
		}

		return null;
	}

	/**
	 * Returns the string value of the constant.
	 */
	public String toString() {

		return name;
	}

	/**
	 * Returns the integer value of the constant.
	 * 
	 * @return
	 */
	public int getType() {

		return value;
	}
}
